package dev.werillib.net

import io.reactivex.Observer
import io.reactivex.disposables.Disposable

/**
 * create by weril 2018/11/27
 */
class BaseObserver<T>(var requestBack: RequestBack<T>) : Observer<T> {
    override fun onComplete() {
    }

    override fun onSubscribe(d: Disposable) {
    }

    override fun onNext(t: T) {
        requestBack.success(t)
    }

    override fun onError(e: Throwable) {
        requestBack.fail(e)
    }


}